

namespace CSharpPro._1103;

/// <summary>
/// 用户服务接口（定义登录、注册等业务方法）
/// </summary>
public interface IUserService
{
    /// <summary>
    /// 用户注册
    /// </summary>
    /// <param name="username">用户名</param>
    /// <param name="password">密码</param>
    /// <param name="confirmPassword">确认密码</param>
    /// <returns>注册结果提示</returns>
    string Register(string username, string password, string confirmPassword);

    /// <summary>
    /// 用户登录
    /// </summary>
    /// <param name="username">用户名</param>
    /// <param name="password">密码</param>
    /// <returns>登录结果提示</returns>
    string Login(string username, string password);

    /// <summary>
    /// 获取当前登录用户
    /// </summary>
    User CurrentUser { get; }

    /// <summary>
    /// 退出登录
    /// </summary>
    void Logout();
}
